package com.jiyun.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jiyun.util.LocalDateStringConverter;
import lombok.Data;

import java.time.LocalDate;

@Data
public class Emp {

    @ExcelProperty("ID")
    private Integer id;

    @ExcelProperty("姓名")
    private String name;

    @ExcelProperty("性别")
    private String sex;

    @ExcelProperty("爱好")
    private String hobby;

    @ExcelProperty("地址")
    private String address;

    @ExcelProperty(value = "创建日期", converter = LocalDateStringConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT-8")
    // 日期时间类型，可以自动转化LocalDateTimeStringConverter
    private LocalDate birthday;
    @ExcelIgnore // 导出数据的时候，忽略
    private Integer did;

    @TableField(exist = false)// 忽略当前字段
    @ExcelIgnore // 导出数据的时候，忽略
    private Dept dept;

    @TableField(exist = false)// 忽略当前字段
    @ExcelProperty("部门名称")
    private String deptName;
}
